<ion-view view-title="未完成订单">
     <script id="my-popover.html" type="text/ng-template">
        <ion-popover-view  style="width:100%">
            <ion-header-bar>
                <h1 class="title">{{type}}订单编号：{{order_id}} 总价：{{total}}</h1>
            </ion-header-bar>
            <ion-content>
                <div class="card">
                    <label class="item item-input">
                        <span class="input-label">支付账户</span>
                        <input type="text" ng-model="p_user.pay_name" required>
                    </label>
                    <label class="item item-input">
                        <span class="input-label">密码</span>
                        <input type="password" ng-model="p_user.pay_password" required>
                    </label>
                    <ion-item>
                        <button ng-click="pay()" class="button button-balanced button-outline button-block">确认支付</button>
                    </ion-item>
                </div>
            </ion-content>
        </ion-popover-view>
    </script>
    <ion-content>
        <div class="card" ng-repeat="order in orderlist | orderBy:'-order_id'" ng-show="order.state != '已完成'">
            <ion-item >
                订单编号：{{order.order_id}}
            </ion-item>
            <ion-item>
                商品编号：{{order.product_id}}
            </ion-item>
            <ion-item>
                商品名称：{{order.product_name}}
            </ion-item>
            <ion-item>
                购买数量：{{order.product_number}}
            </ion-item>
            <ion-item>
                订单总额：￥{{order.totalPrice}}
            </ion-item>
            <ion-item>
                卖家：{{order.seller_name}}
            </ion-item>
            <ion-item>
                下单时间：{{order.buy_time}}
            </ion-item>
            <ion-item>
                完成时间：{{order.get_time}}
            </ion-item>
            <ion-item>
                订单状态：{{order.state}}
            </ion-item>
            <button ng-show="order.state =='未确认'" ng-click="modify(order.order_id,'已取消')" class="button button-outline button-balanced button-block">取消订单</button><br>
            <button ng-show="order.state =='已确认'" ng-click="pay(order.order_id,order.totalPrice,0,$event)" class="button button-outline button-assertive button-block">立即付款</button>
            <button ng-show="order.state =='已发货'" ng-click="pay(order.order_id,order.totalPrice,1,$event)" class="button button-outline button-balanced button-block">确认收货</button><br>
        </div>
    </ion-content>
</ion-view>